import Vue from 'vue';
const alertModal = Vue.extend(require('./alertModal.vue').default);
let instance;
let alerts= {
    open(options) {
        if (typeof options != "object"&&options.el==undefined) return;
        if (!instance)
        {
            console.log(options.title)
            instance = new alertModal({ propsData: options });
            instance.modalVisible = true;
            instance.onCloseFun = this.close;
        }
        instance.vm = instance.$mount()
        document.getElementById("app").appendChild(instance.vm.$el);

    },
    close() {
        if (instance) {

            instance = null;
        }
    }
};
export default alerts;